package com.campus;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/3/4
 */
// Square 类，继承自 Rectangle 类
public class Square implements Shape {
    private double side;
    public Square(double side) {
        this.side=side;
    }

    @Override
    public double getArea() {
        return side * side; // 面积 = 长 * 宽
    }

    @Override
    public double getPerimeter() {
        return 2 * (side + side); // 周长 = 2 * (长 + 宽)
    }
}
